{extend name="public/original" /}
{block name="title"}编辑角色{/block}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__JS__/layuiext/eleTree/eleTree.css">
<link rel="stylesheet" type="text/css" href="__CSS__/authtree.css">
{/block}
{block name="content"}
<div class="layui-form" lay-filter="filter-form-auth" id="form-auth" style="padding: 20px 30px 0 0;">
  <div class="layui-form-item">
    <label class="layui-form-label">角色名</label>
    <div class="layui-input-inline">
      <input type="text" name="rolename" lay-verType="tips" lay-verify="required" placeholder="请输入角色名" autocomplete="off" class="layui-input" value="{$role.title}">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">规则</label>
    <div class="layui-input-block" >
      <input type="checkbox" name="" title="全选" lay-skin="primary" lay-filter="allcheck">
    </div>
    <div class="layui-input-block" >
      <div id="tree_node" data-url="{:route('AuthSet/rulesChecked')}"></div>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">描述</label>
    <div class="layui-input-block" >
      <textarea placeholder="" class="layui-textarea" name="desc" lay-verType="tips" lay-verify="descNeed">{$role.remark}</textarea>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-inline">
      <input type="checkbox" name="status" lay-skin="switch" lay-text="开启|关闭" value="1" {if $role.status == 1}checked{/if}>
    </div>
  </div>
  <div class="layui-form-item layui-hide">
    <input type="hidden" name="role_id" value="{$role.id}" />
    <input type="hidden" name="{:config('this.form_token')}" value="{:token()}" />
    <input type="button" lay-submit lay-filter="role-submit" id="role-submit" value="确认" data-url="{:route('AuthSet/addNewRole')}">
  </div>
</div>
<input type="hidden" name="hadRules" value="{$role.rules}">
{/block}
{block name="footjs"}
<script type="text/javascript" src="__STATIC__/mod/admin/authset/role_edit.js" id="roleadd" data-path="__JS__"></script>
{/block}